#coding:utf-8
#宴会成员 3-4
feast = ['zhangsan', 'lisi', 'wangerma']
print(feast[0].title() + ', come and have dinner with me.')
print(feast[1].title() + ', come and have dinner with me.')
print(feast[2].title() + ', come and have dinner with me.\n')
len(feast)

#	练习 3-5
print(feast[1].title() + ", can't come to dinner because he has to work overtime\n")
feast[1] = 'xiaoer'
print(feast)
print(feast[0].title() + ', come and have dinner with me.')
print(feast[1].title() + ', come and have dinner with me.')
print(feast[2].title() + ', come and have dinner with me.\n')

#	添加成员	3-6
print('I found a bigger table and wanted to invite three more people to dinner\n')

feast.insert(0, 'boss')
print(feast)

feast.insert(2, 'queue-jumper')
print(feast)

feast.append('last man')
print(feast)


print(feast[0].title() + ', come and have dinner with me.')
print(feast[1].title() + ', come and have dinner with me.')
print(feast[2].title() + ', come and have dinner with me.')
print(feast[3].title() + ', come and have dinner with me.')
print(feast[4].title() + ', come and have dinner with me.')
print(feast[5].title() + ', come and have dinner with me.\n')

#	3-7 缩减名单
print('Because the newly purchased cutlery cannot be delivered in time, we can only invite two guests\n')

print(feast)
popped_feast = feast.pop()
print(popped_feast.title() + ", I'm sorry I can't invite you to dinner.\n")

first_feast_pop = feast.pop(0)
print(first_feast_pop + ", I'm sorry I can't invite you to dinner.\n")
print(feast)

tertiumQuid = feast.pop(1)
print(tertiumQuid + ", I'm sorry I can't invite you to dinner.\n")
print(feast)

last_feast = feast.pop()
print(last_feast + ", I'm sorry I can't invite you to dinner.\n")
print(feast)

print(feast[0].title() + ", You're still the one I invited for dinner.")
print(feast[1].title() +", You're still the one I invited for dinner.\n")

del feast[0]
print(feast)

del feast[0]
print(feast)



print('The list is empty!\n')




